home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / 386bsd-faq / part4 < prev    next >
Encoding:
Text File  |  1995-07-25  |  42.6 KB  |  1,167 lines

  1. Subject: [comp.os.386bsd] BNR/2 derived BSD for PCs FAQ (Part 4 of 10)
  2. Newsgroups: comp.os.386bsd.announce,comp.answers,news.answers
  3. From: burgess@cynjut.infonet.net (Dave Burgess)
  4. Date: 13 Nov 1994 10:41:44 -0600
  5.  
  6. Posted-By: auto-faq 3.1.1.2
  7. Archive-name: 386bsd-faq/part4
  8.  
  9. Section 3.    (Kernel Building and Maintenance)
  10.  
  11. 3.0    System Internals
  12.     
  13.     One of the interesting aspects of *BSD is the fact that it comes 
  14.     with the complete source.  This allows you to make changes to the 
  15.     system, recompile, and test out your new ideas.  This section of 
  16.     the FAQ describes many of the different aspects of this endeavor 
  17.     and common problems and pitfalls that are encountered.  Kevin Lahey 
  18.     provided the substantial portion of this section.  You can contact 
  19.     him via E-Mail at (kml@rokkaku.atl.ga.us) or contact Dave Burgess 
  20.     (burgess@cynjut.infonet.net).
  21.  
  22. 3.1    Kernel
  23.  
  24. 3.1.1    How do I build a kernel?
  25.  
  26.     The kernel can be compiled in a variety of ways to support different 
  27.     devices and configurations.  Compilation is controlled by a config 
  28.     file that specifies the characteristics of the kernel.  A set of 
  29.     different config files is located in /sys/i386/conf or 
  30.     /sys/arch/i386/conf.  The configuration file names are in upper case.
  31.  
  32.     To build a particular kernel (in this example, we use the GENERICISA
  33.     configuration file in NetBSD or FreeBSD):
  34.  
  35.     % cd /sys/i386/conf
  36.     % config GENERICISA
  37.     % cd /sys/compile/GENERICISA
  38.     % make depend
  39.     % make
  40.  
  41.     If you are using 386bsd 0.1, you'll need patch 1 from the patchkit 
  42.     to get the compilation to work, because the version file isn't 
  43.     correctly included in the Makefile.
  44.  
  45.     In NetBSD, since there are multiple architectures supported, there
  46.     is an architecture line in the middle of the path to these files.
  47.     See the build.kernel script in section 3.8 for more information.
  48.  
  49.  
  50. 3.1.2    I want to do one of the following things:
  51.     * add a device not in the distributed kernel (third com
  52.       port, additional disk or tape, line printer driver, etc).
  53.     * use a patch from the net or the patchkit to fix a kernel bug.
  54.     * add another swap device.
  55.     * recompile the kernel to remove extraneous devices so that
  56.       it takes up less space.
  57.     * configure more pseudo-terminals to allow for more xterms
  58.       or network logins.
  59.     
  60.     You're going to have to recompile the kernel after you modify the 
  61.     config file.  See section 3.2 below for more information about the 
  62.     config file in general.
  63.     
  64.  
  65. 3.1.3    I don't have the source distribution -- how can I rebuild the
  66.     kernel?
  67.  
  68.     There are reference sites available, as well as the 'good 
  69.     net-neighbor' policy, whereby you could make arrangements 
  70.     with a net neighbor to use a large local machine as a Network 
  71.     File System (NFS), or allow you to compile a new kernel on 
  72.     their machine and transfer it to yours.  You can also ask for 
  73.     help from comp.os.386bsd.questions if you get stuck and cannot 
  74.     make any headway.
  75.  
  76.  
  77. 3.1.4    Now that I have a kernel, how do I install it?
  78.  
  79.     Your kernel is called /386bsd or /netbsd.  Copy the new kernel
  80.     from /sys/compile/GENERICISA/386bsd to /, assuming that it is 
  81.     in that directory.  This is relatively straightforward; there 
  82.     are a couple of things to remember, though.  First, if you 
  83.     really screw up the new kernel, you want to have something to 
  84.     fall back on, so be sure to save /386bsd to /386bsd.old before 
  85.     copying in a new kernel.  Second, if you just copy the new 
  86.     kernel over the currently running kernel, funny things can 
  87.     happen.  Be sure to move aside the currently running kernel 
  88.     before copying over the new one.  
  89.  
  90.     There are folks that have reported that overwriting their
  91.     current kernel has never caused them any real problems.  On the  
  92.     other hand, if the old kernel was working and the new one 
  93.     doesn't, and you have made changes that require that old 
  94.     kernel, it should be available to the system, and saving it 
  95.     to /386bsd.alt or /386bsd.old are reasonable things to do.
  96.  
  97.     If you are really paranoid, you can mount a new fixit floppy 
  98.     and replace its kernel with the one you just built, and then
  99.     boot from the fixit floppy to make sure everything will work.
  100.     This is a pretty good idea if you are making radical changes or
  101.     if you are unsure about your changes.
  102.   
  103.  
  104. 3.1.5    After installing the patchkit and recompiling the kernel with the
  105.     option "WD8013", I am no longer able to reboot the machine.  A
  106.     cold boot (power on) runs fine, but after a reboot no boot drive
  107.     is found by the BIOS.  Besides having a 16-bit WD/SMC Ethernet
  108.     card installed the machines try to boot using either a Adaptec
  109.     1742 or 1542 SCSI board to boot from.
  110.  
  111.     This answer was provided by Hellmuth Michaelis (hm@hcshh.hcs.de)
  112.     and by Rodney Grimes (rgrimes@acacia).
  113.  
  114.     Remove "option WD8013" from the config files and recompile and
  115.     reinstall the kernel. 
  116.  
  117.     The reason that option WD8013 often causes this reboot problem is 
  118.     this:
  119.     
  120.     There is a requirement that all memory within a 128k bank in the
  121.     0xA0000 to 0xFFFFF region be either 16-bit or 8-bit.  On a cold 
  122.     boot, the WD8013 boards are reset to 8-bit mode, the POST
  123.     (Power On Self Test) passes without error.  386bsd comes up, the 
  124.     if_we.c driver places the WD8013 in 16-bit mode.  Now on a soft boot
  125.     when the BIOS runs some quick POST tests it finds a problem in the 
  126.     0xA000 to 0xF000 region.  You probably get a "beep-beep" when this
  127.     happens.  It means you have a memory size conflict.
  128.     The machine has been mis-configured.
  129.     
  130.     This is a little known fact about 16-bit vs 8-bit option cards.
  131.     It has caused more than one person to go crazy tracking down
  132.     what they swear is a bug in the program.  It is not, it is a
  133.     flaw in the design of the ISA bus.  The signal MEMCS16- must be 
  134.     returned the same for every 128k block of memory:
  135.     
  136.         B0000-CFFFF    Must all be either 8-bit or 16-bit.
  137.         D0000-FFFFF    Must all be either 8-bit or 16-bit.
  138.     
  139.     In your particular configuration (WD8013 @ cc000) I suspect that
  140.     you have another board in the B0000-CFFFFF region that is 8-bit, 
  141.     i.e.  your Adaptec has an 8-bit BIOS on it!
  142.     
  143.     Try moving the board to the 0xD0000 region and see if it works 
  144.     there, you may still have a problem as many modern system BIOSes
  145.     are now 8-bit.  If your system BIOS is 8-bit, try shadowing the
  146.     system BIOS region at 0xF0000 to 0xFFFFF, this effectively turns 
  147.     it into a 16-bit BIOS.  
  148.  
  149.     Do not attempt to shadow the WD8013, it will cause you many
  150.     headaches.
  151.     
  152.     As always, works for me, you mileage may vary..
  153.     
  154.  
  155. 3.1.6    My system is complaining about stray interrupt 7.  Is my machine 
  156.     going to explode or anything?
  157.  
  158.     No.  They are caused by lots of things.  They are, as far as
  159.     anyone that should be expected to know about this stuff, harmless.
  160.     There are ramifications on them being there, but for MOST users
  161.     they do not pose a real threat to your operations.  For those of
  162.     you that are doing REALLY interrupt intensive stuff, you may want
  163.     to grab a technical reference and figure out why the 8259 is not
  164.     getting reset correctly.
  165.  
  166.     In spite of the number of times this has come up (and people have
  167.     even referenced this section) there are still at least two 
  168.     questions on the net about this.  A memorable one was a guy who
  169.     was just vehement that the stray int 7 was what was keeping his
  170.     system from booting.  In fact, he went so far as to say that this
  171.     document was practically worthless because I didn't tell him how
  172.     to fix it.  Of course, once he configured his hard drive controller 
  173.     so that it was on the right interrupt, his booting problem went 
  174.     away.  I have said it before and I will say it again.  For MOST 
  175.     users they do not pose a real threat to your operations.
  176.     I have heard of three people (out of at least 2000) that have
  177.     actually have problems so bad that they couldn't proceed.  They
  178.     bought new computers, and the problem went away.
  179.  
  180.     These stray interrupts are caused by something in the PC.  
  181.     I have yet to see a convincing explanation of precisely what,
  182.     but they are definitely caused by something.  There are four
  183.     ways to deal with this problem.
  184.  
  185.     1)  Ignore them.  They are spurious and do not effect the
  186.     operation of your computer.
  187.  
  188.     2)  Implement the lpt driver.  This way, the driver traps 
  189.     (the lpt driver expects IRQ 7) and then quietly discards them.  
  190.     That is why when folks implement the lpt driver the 'problem' 
  191.     goes away.  The computer is taught how to ignore them.
  192.  
  193.     3)  Do what the original 386bsd code did.  Comment out the
  194.     diagnostic and associated code that tries to deal with them so
  195.     you don't see the error message.
  196.  
  197.     4)  Buy a new computer that doesn't cause this problem.   It is a
  198.     known hardware problem with the 8259 being reset incorrectly in
  199.     hardware.
  200.  
  201.  
  202. 3.1.7    I keep getting "wd0c: extra interrupt".  What does it mean?
  203.  
  204.     It means that the drive was already processing a command 
  205.     (active) when it recieved an interrupt from the system telling 
  206.     it to see if it had anything to do.  This is mostly harmless 
  207.     but could indicate that the drive/controller is having problems 
  208.     if the message appears often.
  209.  
  210.     
  211. 3.1.8    I found a bug in the kernel.  How do I report it?
  212.  
  213.     Both NetBSD and FreeBSD include a facility called 'bugfiler'.  
  214.     While the instructions are included in both system, there is 
  215.     still some apparent confusion about when to use (and when to
  216.     NOT use) bugfiler.
  217.  
  218.     Jordan K. Hubbard (jkh@whisker.lotus.ie)  provides us with this
  219.     short article for FreeBSD.
  220.  
  221.     To send bug reports, you want to use the sendbug(1) command.
  222.     The entire package for sending and filing these bugs is known 
  223.     as "the bugfiler", which is where the confusion stepped in, 
  224.     but sendbug is definately the command you want to use.
  225.  
  226.     Second, it doesn't take a "net connection" to use sendbug, 
  227.     since all it does is package up your "bug report form" and mail 
  228.     it to us; no direct internet connectivity is required, just mail.
  229.  
  230.     So if you can send internet mail you can use sendbug, or you can 
  231.     also send mail to the `FreeBSD-bugs@freefall.cdrom.com' address 
  232.     (do NOT send it to FreeBSD.cdrom.com since it will BOUNCE, this 
  233.     is not the place to send bugs to, just to ftp stuff from!).
  234.  
  235.     NetBSD has a similar facility, but has a different program and
  236.     host for bug reports.  The program for NetBSD is called send-pr
  237.     and is slightly different in several respects.  It is
  238.     recommended that NetBSD users see the man page on send-pr
  239.     before filing bug reports.
  240.  
  241.  
  242. 3.1.9    Can someone please give a reasonably clear set of instructions 
  243.     as to how to get a "current" version of NetBSD running?
  244.  
  245.     Marc Wandschneider <marcwan@microsoft.com> provided this
  246.     description of what he did to upgrade to the (then) current
  247.     version of NetBSD:
  248.  
  249.     1. Delete the old source tree, saving what I wanted to (a bunch
  250.     of files moved around, and just unpacking the new one over the
  251.     old will cause some problems)
  252.  
  253.     2. Unpacked the new source tree.
  254.  
  255.     3. ran the following sequence of commands:
  256.  
  257.         cd /usr/src/share/mk; make install
  258.         cd /usr/src/include; make && make install
  259.            setenv LDSTATIC -static
  260.            setenv NOPIC
  261.         cd /usr/src/lib/libc; make && make install
  262.         cd /usr/src/gnu/lib/libmalloc; make && make install
  263.            cd /usr/src/gnu/usr.bin/gas; make && make install
  264.            cd /usr/src/gnu/usr.bin/ld; make && make install
  265.         # You'll probably get some barfage from the above because 
  266.         # ld.so won't build yet.  Ignore it and install ld anyway.
  267.            cd /usr/src/gnu/usr.bin/gcc; make && make install
  268.            unsetenv NOPIC LDSTATIC
  269.            cd /usr/src/lib ; make && make install
  270.            cd /usr/src/gnu/lib ; make && make install
  271.         cd /usr/src/gnu/usr.bin/ld; make && make install
  272.            cd /usr/src; make && make install
  273.  
  274.     At some point during the installation, your system will be 
  275.     fixed enough that many of these steps will no longer be required.
  276.     For example, the new 'make' defines the variables OBJDIR and 
  277.     MACHINE_ARCH for you, so you will not need those  once you get to
  278.     that point.  Until then, the following procedure may suit your
  279.     needs better.
  280.  
  281.         #! /bin/csh
  282.  
  283.         unsetenv NOPIC LDSTATIC
  284.         setenv MACHINE_ARCH i386
  285.         # Pick one of these three setenv lines.
  286.         #  setenv MAKE "make clean "
  287.         #  setenv MAKE "make obj "
  288.             setenv MAKE  
  289.         cd /usr/src/share/mk 
  290.            make install
  291.         cd /usr/src/include 
  292.            $MAKE
  293.            make && make install
  294.         setenv LDSTATIC -static
  295.         setenv NOPIC
  296.         cd /usr/src/usr.bin/make
  297.            $MAKE 
  298.            make && make install
  299.         
  300.         cd /usr/src/usr.bin/rpcgen
  301.            $MAKE 
  302.            make && make install
  303.         
  304.         cd /usr/src/lib/libc 
  305.            $MAKE 
  306.            make && make install
  307.         
  308.         cd /usr/src/gnu/lib/libmalloc
  309.            $MAKE 
  310.            make && make install
  311.         
  312.         cd /usr/src/gnu/usr.bin/gas
  313.            $MAKE 
  314.            make && make install
  315.         
  316.         cd /usr/src/gnu/usr.bin/ld
  317.            $MAKE 
  318.            make && make install
  319.         
  320.         cd /usr/src/gnu/usr.bin/gcc2 
  321.            $MAKE 
  322.            make && make install
  323.         
  324.         #
  325.         unsetenv NOPIC LDSTATIC
  326.         
  327.         cd /usr/src/lib 
  328.            $MAKE 
  329.            make && make install
  330.         
  331.         cd /usr/src/gnu/lib 
  332.            $MAKE 
  333.            make && make install
  334.         
  335.         cd /usr/src/gnu/usr.bin/ld 
  336.            $MAKE 
  337.            make && make install
  338.         
  339.         cd /usr/src 
  340.            make && make install
  341.         
  342.         
  343.     NOTE: At some point, you might very well come across an
  344.     unresolved external __DYNAMIC in crt0.o.  If this happens, edit
  345.     the makefile for crt0.o (lib/csu/i386) and remove the -DDYNAMIC 
  346.     flag) make && make install.  Then put the flag back in the
  347.     makefile (but don't rebuild it until the natural order of things 
  348.     dicates that it happen)
  349.  
  350.     And Theo Deraadt provides this guidance when you get an error
  351.     like "init_main.o: Undefined symbol _pdevinit referenced from
  352.     text segment."
  353.  
  354.     You need to
  355.         (1) install new config
  356.         (2) make clean
  357.         (3) re-config your kernel
  358.     then this goes away
  359.  
  360.  
  361. 3.2    What exactly is this config file, anyway?  What are all of these 
  362.     cryptic notations?
  363.  
  364.     I've annotated the distributed 386bsd GENERICISA file;  my comments 
  365.     are delineated by the '--' symbols.  
  366.  
  367.     THIS IS NOT A COOK-BOOK.  YOU WILL NEED TO DO THE RESEARCH (LIKE
  368.     LOOKING AT THE 20 OTHER CONFIG FILES) TO SEE WHAT IS CURRENT AND
  369.     WHAT YOU WILL NEED IN YOUR CONFIG FILE.
  370.  
  371.     #
  372.     # GENERICISA -- Generic ISA machine -- distribution floppy
  373.     #
  374. --  BSD can be compiled for different hardware platforms, so it is important to
  375. --  define the hardware types.  386bsd can only be built for 386 or
  376. --  compatible machines, so this is sort of superfluous, but maintains
  377. --  compatibility with standard BSD config files.
  378.     machine        "i386"
  379.     cpu        "i386"
  380. --  The ident describes the machine for which this kernel is to be built.
  381. --  It is usually the system name -- "ROKKAKU", "REF", or whatever.
  382. --  This can be used for conditional compilation, so that kernel changes
  383. --  can be compiled in only for one machine.
  384.     ident        GENERICISA
  385. --  This should indicate the timezone of the system relative the
  386. --  Greenwich.   8 is PST;  4 is EST.  A fuller explanation is provided
  387. --  below.
  388.     timezone    8 dst 7
  389. --  maxusers isn't strictly checked;  it is just used to size several
  390. --  system data parameters.
  391.     maxusers    10
  392. --  The options control the conditional compilation of features into the
  393. --  kernel.  The options can be listed all on a line separated by commas.
  394. --  They are #define'ed when the kernel is compiled, so that #ifdef's
  395. --  will work.  An option can be given a value by appending an equals sign
  396. --  and a value (enclosed in double quotes) to the option name.
  397.     
  398. --  Hopefully the names are at least somewhat self-explanatory.  To
  399. --  discover what everything does, you'd have to go through the kernel
  400. --  looking for all of the appropriate #ifdef's.
  401.     
  402. --  [Perhaps somebody else could list the *exact* meanings of these
  403. --  options and some of the other possible options?]
  404.     options        INET,ISOFS,NFS
  405.     options        "COMPAT_43"
  406.     options        "TCP_COMPAT_42"
  407.     
  408. --  The config line controls the location of the root, swap, and dump
  409. --  devices.  Anything not specified is defaulted.  This is where you add
  410. --  support for multiple swap devices.  Just list 'em, separated by 'and'.
  411. --  The config line below identifies the root drive as wd0 and the
  412. --  swap drives as wd0 and as0.  See the section on swap devices in FAQ_02
  413. --  for additional information.
  414.     config        "386bsd"    root on wd0 swap on wd0 and as0
  415. --  A 'controller' is a device or bus controller.  'isa' is obviously for
  416. --  the ISA bus.  'wd0' is for regular disk controllers,  'fd0' is for the
  417. --  floppies, and 'as0' is for SCSI disk controllers.
  418.     controller    isa0
  419. --  The fields work as follows:
  420.     
  421. --  a.  What do you call this device?  
  422. --  b.  What controller is this on?  As you can see, the disk controller
  423. --  talks to the ISA bus, and the disks talk to the disk controller.
  424. --  c.  Where are the registers for the controller mapped into memory?
  425. --  This is #defined in /sys/i386/isa/isa.h.
  426. --  d.  What IRQ is this device set up for?
  427. --  e.  What routine should be called on an interrupt from the device?
  428.     
  429. --             a          b           c             d           e
  430. --            vvv        vvv       vvvvvvv          vv        vvvvvv
  431.     controller    wd0    at isa? port "IO_WD1" bio irq 14 vector wdintr
  432. --  You need a 'disk' entry for every disk on the controller.  In the
  433. --  config file originally shipped with 386bsd, both hard disks were 
  434. --  incorrectly identified as wd0.  Be sure to change the second occurrence 
  435. --  to wd1, as I have done in below.
  436.     disk        wd0    at wd0 drive 0
  437.     disk        wd1    at wd0 drive 1
  438.     
  439.     controller    fd0    at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
  440.     disk        fd0    at fd0 drive 0
  441.     disk        fd1    at fd0 drive 1
  442.  
  443. --  The 'drq' specifies the channel used for bus-mastering DMA.
  444.     controller    as0    at isa? port 0x330 bio irq 11 drq 5 vector asintr
  445.     disk        as0    at as0 drive 0
  446.     disk        as1    at as0 drive 1
  447.  
  448. --  Define other physical devices.  pc0 is the keyboard, npx0 drives the
  449. --  math coprocessor, and com* controls the com ports.
  450.     device        pc0    at isa? port "IO_KBD" tty irq 1 vector pcrint
  451.     device        npx0    at isa? port "IO_NPX" irq 13 vector npxintr
  452.     device        com1    at isa? port "IO_COM1" tty irq 4 vector comintr
  453.     device        com2    at isa? port "IO_COM2" tty irq 3 vector comintr
  454.     
  455. --  Ethernet drivers of various sorts and the particular configuration
  456. --  information they require.  For most installations, only one of these 
  457. --  devices would normally be defined.
  458.     device we0 at isa? port 0x280 net irq 2 iomem 0xd0000 iosiz 8192 vector weintr
  459.     device ne0 at isa? port 0x300 net irq 2 vector neintr
  460.     device ec0 at isa? port 0x250 net irq 2 iomem 0xd8000 iosiz 8192 vector ecintr
  461.     device is0 at isa? port 0x280 net irq 10 drq 7 vector isintr
  462.  
  463. --  Tape driver
  464.     device        wt0    at isa? port 0x300 bio irq 5 drq 1 vector wtintr
  465.     
  466. --  The TCP/IP loop-back device, ethernet interface, slip interface, log
  467. --  device, and pseudo-terminals.
  468.     pseudo-device    loop
  469.     pseudo-device    ether
  470.     pseudo-device    sl    2
  471.     pseudo-device    log
  472.     pseudo-device    pty    4
  473.     
  474. --  Devices required by VM. 
  475.     pseudo-device    swappager
  476.     pseudo-device    vnodepager
  477.     pseudo-device    devpager
  478.  
  479.     Normally, there is an annotated configuration file called ALL which
  480.     gives a list of all of the options for the configuration file.
  481.     
  482.     The configuration file that was used to create the list above
  483.     was for a 386BSD system.  Many things have changed in the
  484.     config files for NetBSD and FreeBSD.  As an example, the
  485.     psuedo-devices swappager, vnodepager, and devpager are now full
  486.     fledged devices.  Like it said up at the top, use the config
  487.     files that come with your system as a basis for your own
  488.     experiments in kernel building.
  489.  
  490. 3.2.1    Okay, fine.  Why shouldn't I just add every device I can find to
  491.     the kernel, so I'll never have to recompile this again?
  492.  
  493.     Because it takes up space.  The kernel is wired into memory, so 
  494.     every byte it uses comes out of the pool of memory for everything 
  495.     else.  It can't page out sections that aren't in use.  If your 
  496.     kernel is larger than 640K, then it can't be loaded.  You'll need 
  497.     to use Julian Elischer's bootblocks to put it in high memory, which 
  498.     seem to be fairly complex.  Installing them (once they are 
  499.     compiled) is as easy as using disklabel.
  500.  
  501.     Newer versions of the *BSD kith provide the capability to build
  502.     a kernel that is larger than 640K.  Complete instructions are
  503.     provided in the appropriate systems.
  504.  
  505.  
  506. 3.2.2    What should I remove from the kernel?
  507.  
  508.     What do you need?  If you only have an SCSI controller, you don't 
  509.     need the wd0 device;  if you have another kind of disk controller, 
  510.     you don't need as0.  Unless you actually HAVE more than one Ethernet 
  511.     controller, you should comment out all but one of them.  If you don't 
  512.     have an ethernet controller, you don't need any of the controllers or 
  513.     NFS compiled in.   Without a CD-ROM, ISOFS is kind of pointless.  Just 
  514.     look at what you have and think about what you really need.
  515.  
  516.  
  517. 3.2.3    I can't get enough remote login sessions or xterm sessions.  I also
  518.     can only get four seesions working at a time.  What can I do?
  519.  
  520.     Increase the count of pseudo-terminals --
  521.  
  522.     pseudo-device    pty    12  # or whatever
  523.  
  524.     Every pseudo terminal should have a /dev/pty* entry.  If you have 12
  525.     pseudo terminals, you should also have at least 12 pty devices in the
  526.     /dev directory.  The MAKEDEV script in /dev will create as many pseudo-
  527.     terminals as you tell it to.
  528.  
  529.  
  530. 3.2.4    How do I get ddb, the kernel debugger, compiled into the kernel
  531.     and running?
  532.  
  533.     Add the following line to the configuration file:
  534.  
  535.     pseudo-device    ddb
  536.  
  537.     Build the kernel, then run dbsym on it:
  538.  
  539.     % dbsym ./386bsd
  540.  
  541.     Install it and go for it.  Ctl-Alt-Esc drops you into the debugger.
  542.  
  543.     Note: DDB as shipped originally is a memory hog, and it is very
  544.     difficult to get a kernel small enough with enough fun things in it
  545.     to debug in 640K
  546.  
  547.  
  548. 3.2.5    Can I have more than one config file?  Should I rename it to something
  549.     else?  Any other hints?  
  550.  
  551.     You can create as many (or as few) config files as you desire.  The 
  552.     system, once the patchkit is applied, will have between 10 and 15, 
  553.     each of which implements certain functions or features.  In addition, 
  554.     the normal place for the patchkit to make changes to the config files 
  555.     is in the GENERICISA file.  Since this file should remain unchanged 
  556.     and available, it is always a good idea to copy this file to a 
  557.     meaningful name and modify that file.  In other words, change every 
  558.     reference in 3.1.1 from GENERICISA to HAL (or whatever you call your 
  559.     system).
  560.  
  561.     One final note.  Every /sys/compile directory takes up 800K or so;
  562.     you might want to watch to see how big these all get.
  563.  
  564.  
  565.  
  566. 3.2.6    What is the meaning of the trap codes I get in panic messages?
  567.     Sometimes this message appears in the form "trap type nn".
  568.  
  569.     That message means that the system received an unexpected (and
  570.     unwanted) trap that probably indicates some form of kernel bug.
  571.     These traps, are usually received from the kernel, in which case
  572.     the trap.h definitions should be used.
  573.  
  574.     The number (which appears in place of "nn" above) is *NOT* the 
  575.     i386 or i386 trap type, it is a BSD-defined trap type number.
  576.  
  577.     The definitions of the various trap types can be found in
  578.     /usr/include/machine/trap.h.
  579.  
  580.     two of the more common ones are:
  581.           9    T_PROTFLT    protection fault
  582.                 (The kernel tried executing code
  583.                 which was not noted as "executable".
  584.                 This happens if the kernel jumps to
  585.                 a bogus location.)
  586.          12    T_PAGEFLT    page fault
  587.                 (The kernel tried to access a bogus
  588.                 area of memory.  This can happen if
  589.                 an invalid pointer is dereferenced.)
  590.  
  591.  
  592.     This is a list of i386 trap codes (just to confuse the issue).
  593.  
  594. Trap    0    Divide Error
  595.         The DIV or IDIV instruction is executed with a zero denominator
  596.         or the quotient is too large for the destination operand.
  597.     
  598.     
  599. Trap    1    Debug Exceptions
  600.         Used in conjunction with DR6 and DR7, The following flags
  601.         need to be tested to determine what caused the trap:
  602.         BS=1                Single-step trap
  603.         B0=1 AND (GE0=1 or LE0=1)    Breakpoint, DR0, LEN0, R/W0
  604.         B1=1 AND (GE1=1 or LE1=1)    Breakpoint, DR1, LEN1, R/W1
  605.         B2=1 AND (GE2=1 or LE2=1)    Breakpoint, DR2, LEN2, R/W2
  606.         B3=1 AND (GE3=1 or LE3=1)    Breakpoint, DR3, LEN3, R/W3
  607.         BD=1                Debug registers not available,
  608.                         in use by ICE-386
  609.         BT=1                Task Switch
  610.             
  611.     
  612. Trap    2    NMI Interrupt
  613.         On PC/AT systems, the NMI input to the CPU is usually
  614.         connected to the main memory parity circuit.  By the time the
  615.         error signal is generated, the data may have already been
  616.         used in an instruction, so it isn't possible to reliably
  617.         recover.
  618.     
  619.         And some not-so-common causes (from various sources):
  620.  
  621.           PS50+ : I/O channel check, system watch-dog timer 
  622.           time-out interrupt, DMA timer time-out interrupt
  623.  
  624.           parity errors on any 8-bit or 16-bit board pulling the 
  625.           IOCHCK* line low 
  626.  
  627.           first generation of auto-switching EGA cards used NMI to trap port
  628.           access for CGA emulation (e.g., ATI's EGA Wonder)
  629.     
  630.           Zeos Notebook low battery (perhaps other battery-based 
  631.           computers)
  632.  
  633.  
  634. Trap    3    Breakpoint
  635.         The result of executing an INT 3 instruction.  MS-DOS and
  636.         Windows and some other non-386 systems use this for debugging.
  637.         Code specific to the 386 and later processors should use
  638.         the debugging features tied to Trap 1.
  639.     
  640.     
  641. Trap    4    INT0 Detected Overflow
  642.         Occurs if an INT0 instruction is executed and the overflow
  643.         flag (OF) is currently set.
  644.     
  645.     
  646. Trap    5    BOUND Range Exceeded
  647.         Occurs if the BOUND instruction is executed and the array
  648.         index points beyond the area of memory containing the array
  649.         being tested.
  650.     
  651.     
  652. Trap    6    Invalid Opcode
  653.         The value read at CS:IP is not a valid opcode.
  654.     
  655.     
  656. Trap    7    Coprocessor Not Available
  657.         This occurs if the processor fetches an instruction that is
  658.         for the coprocessor and no coprocessor is present.
  659.     
  660.     
  661. Trap    8    Double Exception (Fault)
  662.         An exception occurred while trying to execute the handler
  663.         for a prior exception.  Example, an application causes a
  664.         General Protection Fault (13) and the area of memory where
  665.         the GPF handler should be is flagged not-present (paged-out?).
  666.         The double-fault handler is invoked in these conditions.
  667.         If a fault occurs while trying to run the double-fault handler,
  668.         a triple-fault occurs and the CPU resets.
  669.     
  670.         The rules for deciding if a double-fault should occur or
  671.         if the two faults can be handled serially are discussed in
  672.         more detail in the Intel song book.
  673.     
  674.     
  675. Trap    9    Coprocessor Segment Overrun
  676.         A page or segment violation occurred while transferring
  677.         the middle part of a coprocessor operand to the NPX.
  678.     
  679.     
  680. Trap    10    Invalid Task State Segment
  681.         During a task switch, the new TSS was invalid.  Here is
  682.         a table of conditions that Invalidate the TSS:
  683.         TSS id + EXT    The limit in the TSS descriptor is < 103
  684.         LTD id + EXT    Invalid LDT selector or LDT not present
  685.         SS id + EXT    Stack segment selector is outside table limit
  686.         SS id + EXT    Stack segment is not a writable segment
  687.         SS id + EXT    Stack segment DPL does not match new CPL
  688.         SS id + EXT    Stack segment selector RPL <> CPL
  689.         CS id + EXT     Code segment is outside table limit
  690.         CS id + EXT    Code segment selector does not refer to
  691.                     code segment
  692.         CS id + EXT    DPL of non-conforming code segment <> new CPL
  693.         CS id + EXT    CPL of conforming code segment > new CPL
  694.         DS/ES/FS/GS id + EXT    DS, ES, FS or GS segment selector is
  695.                     outside table limits
  696.         DS/ES/FS/FS id + EXT    DS, ES, FS, or GS is not readable
  697.                     segment
  698.  
  699.  
  700. Trap    11    Segment Not Present
  701.         Occurs when the "present" bit of a descriptor is zero.
  702.         This can occur while loading any of these segment registers
  703.         CS, DS, ES, FS, or GS.  Loading SS causes a Stack fault.
  704.         Also occurs when attempting to use a gate descriptor that is
  705.         marked "not present", and if attempting to load the LDT with
  706.         an LLDT instruction.  Note that loading the LDT during a
  707.         task switch causes an "invalid TSS" trap.
  708.  
  709.  
  710. Trap    12    Stack Fault
  711.         A limit violation relating to an address referenced off
  712.         the SS register.  Includes POP, PUSH, ENTER and LEAVE
  713.         opcodes, as well as references such as MOV AX,[BP+8]
  714.         (which has an implied SS:).
  715.         Also causes by loading SS with a descriptor that is marked
  716.         "not present".
  717.  
  718.  
  719. Trap    13    General Protection Fault (GPF)
  720.         Americas Favorite, in the Windows 3.0 world, it is known as
  721.         the UAE error.  The instruction tried to access data out of
  722.         the bounds designated by the descriptors.  The access that
  723.         failed can be a read, write or instruction fetch.  There are
  724.         15 classifications of GPFs:
  725.         1.  Exceeding segment limit when using CS, DE, ES, FS or GS.
  726.         2.  Exceeding segment limit when referencing a descriptor
  727.             table.
  728.         3.  Transferring control to a segment that is not executable.
  729.         4.  Writing into a read-only data segment or into a code
  730.             segment.
  731.         5.  Reading from an execute-only segment.
  732.         6.  Loading the SS register with a read-only descriptor
  733.             (unless the selector comes from the TSS during a task
  734.             switch, in which case a TSS exception occurs.)
  735.         7.  Loading SS, DS, ES, FS or GS with the descriptor of a
  736.             system segment.
  737.         8.  Loading, DS, ES, FS or GS with the descriptor of an
  738.             executable segment that is not also readable.
  739.         9.  Loading SS with the descriptor of an executable segment.
  740.         10. Accessing memory via, DS, ES, FS or GS when the segment
  741.             register contains a null selector.
  742.         11. Switching to a busy task.
  743.         12. Violating privilege rules.
  744.         13. Loading CR0 with a PG=1 and PE=0.
  745.         14. Interrupt or exception via trap or interrupt gate from
  746.             V86 mode to privilege level other than zero.
  747.         15. Exceeding the instruction limit of 15 bytes (this can
  748.             only occur if redundant prefixes are placed before an
  749.             instruction).
  750.         To determine which condition caused the trap, you need
  751.         the instruction, the contents of all associated registers,
  752.         particularly the segment registers involved, then the various
  753.         LDT, GDT and page control tables.  Lots of common coding
  754.         errors cause the GPFs.  Even a stack imbalance will usually
  755.         show up as a GPF.   Even MOV AX,7 MOV ES,AX or 
  756.         MOV AX,5 PUSH AX POP DS will get a GPF error.  You can't
  757.         use a segment register for "temporary storage" of any
  758.         old value the way you could on the 8086.  The values loaded
  759.         into the segment registers are checked in protected mode.
  760.  
  761.  
  762. Trap    14    Page Fault
  763.         The page directory or page table entry needed for the address
  764.         translation has a zero in the present bit, or the current
  765.         procedure does not have sufficient privilege to access the
  766.         indicated page.
  767.  
  768. Trap    15    (reserved)
  769.  
  770.  
  771. Trap    16    Coprocessor Error
  772.         The coprocessor asserted the ERROR# input pin on the 386
  773.         (internal on the 486)
  774.  
  775.  
  776. Trap    17    Alignment Check (486 and later)
  777.         If enabled, this trap will occur if a data fetch does not
  778.         occur on a word boundary.  I don't know of any software that
  779.         activates this feature yet.  I have seen SCO UNIX get this
  780.         error on early Cyrix processors, even though SCO had not
  781.         enabled the feature.
  782.  
  783.  
  784. Trap    18-32    (reserved)
  785.  
  786. [answered by     Frank Durda IV <uhclem@nemesis.lonestar.org>    and
  787.         jim mullens jcm@ornl.gov  -or- mullens@jamsun.ic.ornl.gov]
  788.     
  789. -------------------------------------------------------------------------------
  790.  
  791. 3.2.7    I have been getting a lot of "virtual memory exhausted" errors when 
  792.     I am compiling a program with a really big static array.  I have 
  793.     128Meg of memory and 8Gig of swap.  How can this be happening?
  794.  
  795.     If you are using Csh, you can simply unlimit your processes in 
  796.     your system level /etc/csh.cshrc file or your personal .cshrc 
  797.     file.  You can also modify your kernel so that the
  798.     amount of memory available is less limiting.  J"org Wunsch 
  799.     (j@tcd-dresden.de) provides us with this brief description:
  800.  
  801.     From a recent posting i just made, regarding the problem how much
  802.     virtual memory one could get.
  803.  
  804.     | On the other hand, i've also changed the definitions you
  805.     | mentioned. But i didn't like to modify the header files, and
  806.     | actually, modifying the values is as easy as:
  807.     | 
  808.     | options        "DFLDSIZ='(16 * 1024 * 1024)'"
  809.     | options        "MAXDSIZ='(64 * 1024 * 1024)'"
  810.     | 
  811.     | Include the above lines into your kernel's config file, reconfig
  812.     | and rebuild it.
  813.     | 
  814.  
  815.     This is just a hint for those people poking around with compiling
  816.     large source files. Especially, due to some gcc problems with large
  817.     static arrays, compiling X applications with huge bitmaps would
  818.     cause virtual memory trouble. Increasing the limits (o'course, as
  819.     long as the h/w resources suffice) could help there.
  820.  
  821.     The default definitions for the above parameters are found in
  822.     /usr/include/machine/vmparam.h.
  823.  
  824.  
  825. 3.2.8    Where can I learn more about all this?
  826.  
  827.     We've skipped over a lot of details here;  the straight dope comes from
  828.     "Building Berkeley UNIX Kernels with Config", by Samuel J. Leffler and
  829.     Michael J. Karels. 
  830.  
  831.  
  832. 3.2.9    Does anyone have a system building script that takes things like 
  833.     building a new config and multiple config files into account?
  834.  
  835.     This is the program that I use to rebuild my kernel.  See the note
  836.     in the file about my 'test' program.  You may elect to build a
  837.     new config every time, or not, depending on your requirements.
  838.  
  839.  
  840.     #! /bin/sh
  841.     #
  842.     #  Script to rebuild the kernel.
  843.     #
  844.     if [ `whoami` != 'root' ] ; then
  845.       echo 'You must be root to successfully proceed from this point'
  846.       exit 1
  847.     fi
  848.     
  849.     #
  850.     #  Set up the environment
  851.     #
  852.     
  853.     if [ X$MACHINE_ARCH = "X" ] ; then
  854.       MACHINE_ARCH=i386
  855.     fi
  856.     
  857.     if [ -f /netbsd ] ; then
  858.       ARCHDIR='/arch'
  859.     fi
  860.     
  861.     #
  862.     # Rebuild Config
  863.     #
  864.     # I am using a modified test(1) that allows for file date comparisons.
  865.     # You can either get my patches (if they aren't already included),
  866.     # modify test() yourself, or get the GNU ShellUtils test(1) program.
  867.     #
  868.     
  869.     if [ /usr/src/usr.sbin/config -ot /usr/sbin/config ] ; then
  870.       echo "Config Up To Date"
  871.     else
  872.      cd /usr/src/usr.sbin/config
  873.      make clean
  874.      make depend
  875.      make
  876.      make install
  877.     fi
  878.     
  879.     cd /sys
  880.     make
  881.     make install
  882.     
  883.     #
  884.     # Modify the local Configuration File
  885.     #
  886.     echo `tput clr`
  887.     cd /sys$ARCHDIR/i386/conf
  888.     
  889.     if [ "X$CONFIG_NAME" = "X" ]; then
  890.       CONFIG_NAME=GENERIC
  891.     fi  
  892.     
  893.     if [ "X$1" = "X" ]; then
  894.       echo "Configuration Files available:"
  895.       ls [A-Z]*
  896.       echo " "
  897.       echo -n "Enter the name of the config file to use: "
  898.       read CONFIG_NAME
  899.       echo
  900.     else
  901.       CONFIG_NAME=$1
  902.     fi
  903.     
  904.     if [ ! -f $CONFIG_NAME ]; then
  905.       cp GENERIC $CONFIG_NAME
  906.     fi
  907.     
  908.     echo "Modifying $CONFIG_NAME config file"
  909.     echo -n "Press return to continue (q to quit) "
  910.     read ans
  911.     
  912.     ans=`echo $ans | cut -c1 | tr 'QqYy' 'qqqq'`
  913.     
  914.     if [ "X$ans" = "Xq" ] ; then
  915.       exit 0
  916.     fi
  917.     
  918.     vi $CONFIG_NAME
  919.     
  920.     #config.new $CONFIG_NAME
  921.     config $CONFIG_NAME
  922.     
  923.     COMPILE_DIR=/sys$ARCHDIR/i386/compile/$CONFIG_NAME
  924.     
  925.     cd $COMPILE_DIR
  926.     make depend
  927.     make
  928.     
  929.     if [ $? -ge 1 ] ; then
  930.       echo "Errors encountered"
  931.     else
  932.       if [ -f netbsd ] ; then
  933.         PROGNAME=netbsd
  934.       else
  935.         if [ -f freebsd ] ; then
  936.           PROGNAME=freebsd
  937.         else
  938.           PROGNAME=386bsd
  939.         fi
  940.       fi
  941.       echo `tput clr`
  942.       echo ""
  943.       echo "  Manual Installation is recommended.  The following files should be"
  944.       echo "copied/linked/moved to the root directory.  The following steps are"
  945.       echo "suggested:"
  946.       echo ""
  947.       echo "    mv /$PROGNAME /$PROGNAME.old"
  948.       echo "    mv $COMPILE_DIR/$PROGNAME /$PROGNAME"
  949.       echo "    reboot"
  950.       echo ""
  951.       echo "Remember that the new kernel changes will not take place until you "
  952.       echo "re-boot the system."
  953.     fi
  954.  
  955.     
  956. 3.3    X11/XFree86/XS3
  957. 3.3.1    What options should I define to get the X extensions included?
  958.  
  959.     Once you have applied the patch kit, the only thing left to do is to
  960.     modify the config file to include the following line:
  961.  
  962.     options    XSERVER, UCONSOLE
  963.  
  964.     recompile the kernel and the kernel should support X.
  965.  
  966. 3.3.2    Where can I get the FAQ for 'X'?
  967.  
  968.     Steve Kotsopoulos' general 'X on Intel-based Unix' FAQ
  969.     available by anonymous ftp from export.lcs.mit.edu in 
  970.     /contrib/Intel-Unix-X-faq. 
  971.  
  972.  
  973. 3.3.3    Why does X drop characters when using xdm?   When I run xdm 
  974.     from the console, it keeps losing keystrokes and the shift keys 
  975.     don't always work.  Why?
  976.  
  977.         You need to run xdm with the -nodaemon flag.  The reason is
  978.         xdm normally detaches from the keyboard.  This allows other
  979.         processes (like getty) to return to reading from the keyboard.
  980.         A race condition results, where some keystrokes are sent to
  981.         xdm and others are sent to other processes.  Using the
  982.         -nodaemon flag causes xdm to stay attached to the keyboard
  983.         so no other process can use it.  This answer comes from Michael 
  984.         C. Newell (root@wanderer.nsi.nasa.gov)
  985.  
  986.     This bit of trivia is also covered in detail in the X FAQ and 
  987.     the README that accompanies XFree86.
  988.  
  989.  
  990. 3.4    Compiler and Library routines
  991.  
  992.     There are several questions that could probably be included
  993.     here.  See also Section 4 for some of the more common 'missing
  994.     modules' that also happen to be library routines.
  995.  
  996.  
  997. 3.4.1    Which C compiler is shipped with my 386BSD derived system? 
  998.  
  999.     The standard compiler released with 386bsd 0.1 is GCC 1.38.  This
  1000.     version is considered by many people to be the most stable of
  1001.     the GCC versions.  All other Net/2 derived BSD systems have both 
  1002.     1.38 and 2.4+ available.  NetBSD 0.9, for example, is completely 
  1003.     compilable using GCC 2.4.5, which is included as the default
  1004.     compiler.  FreeBSD also ships with the same compiler.
  1005.  
  1006. 3.4.2    Where is libcompat.a?
  1007.  
  1008.     The library libcompat.a is (working from memory here) completely
  1009.     deprecated in 386bsd.  The only exceptions might be the re_comp
  1010.     and re_exec routines, which are discussed in detail in section 4.
  1011.     In addition, things will be added to libcompat.a as they are 
  1012.     deprecated in the newer versions of NetBSD and FreeBSD.  The
  1013.     getreuid() and setreuid() stuff may be heading that way (if they
  1014.     aren't there already.
  1015.  
  1016.     The easiest way around not having a libcompat.a is to simply link 
  1017.     it to a small library, since virtually every other function that
  1018.     is expected in libcompat.a is already include libc.a.
  1019.  
  1020.  
  1021. 3.5    You promised to talk about timezones below.  Are you going to?
  1022.  
  1023.     >I've seen lots of stuff about timezone's being a bit dodgy,
  1024.     >especially with most European timezones changing over to DST on 
  1025.     >the 27th March.  I must say that that was NOT the case for me - 
  1026.     >pumpy (the author's system) is running off the 
  1027.     >/usr/share/zoneinfo/GB-Eire timezone file, (symbolically) linked 
  1028.     >to /etc/localtime, the CMOS clock is running off GMT, and the 
  1029.     >kernel is compiled with "timezone 0".
  1030.  
  1031.     I use /usr/share/zoneinfo/MET as /etc/localtime and have the 
  1032.     kernel configured as
  1033.  
  1034.         timezone        -1 dst 4
  1035.  
  1036.     (My wife is running DOS on this machine for doom sometimes ;-)
  1037.  
  1038.     I set this strange dst value after diging in some old ultrix(?) 
  1039.     man pages.  There were several dst-changing-method listed and 4 
  1040.     was the code for the central europe one.
  1041.  
  1042.     This gave me an idea... I use an Ultrix box every day, so why not...
  1043.  
  1044.     Now, I don't know how closely this applies to NetBSD since 
  1045.     Ultrix is based on a much older version of BSD, and this isn't 
  1046.     for the kernel config, but for an envar of timezone values, but 
  1047.     it's at least somewhat enlightening on possible meanings for 
  1048.     these things.  Could someone in the know shed light on how 
  1049.     accurately this models the timezone stuff in the kernel config?  
  1050.     When I did "man timezone" this is what I got (portion of this 
  1051.     quoted from the DEC MIPS Ultrix 4.3a timezone(3) manpage, 
  1052.     slightly hacked by me (Michael L. VanLoon (michaelv@iastate.edu))
  1053.  
  1054.  
  1055.          STD offset [DST [offset][,start[/time],end[/time]]]
  1056.  
  1057.          the components of the string have the following meaning:
  1058.  
  1059.     STD and DST    Three or more characters that are the 
  1060.             designation for the standard (STD) or 
  1061.             summer (DST) time zone. Only STD is required; 
  1062.             if DST is missing, then summer time does not apply 
  1063.             in this locale. Upper- and lowercase letters are 
  1064.             explicitly allowed.  Any characters except a 
  1065.             leading colon (:), digits, comma (,), minus (-), 
  1066.             plus (+), and ASCII NUL are allowed.
  1067.  
  1068.          offset        Indicates the value to be added to the local 
  1069.             time to arrive at Coordinated Universal Time. The 
  1070.             offset has the form:
  1071.  
  1072.             hh[:mm[:ss]]
  1073.  
  1074.             The minutes (mm) and seconds (ss) are optional. 
  1075.             The hour (hh) is required and may be a single 
  1076.             digit.    The offset following STD is required. If 
  1077.             no offset follows DST, summer time is assumed to 
  1078.             be one hour ahead of standard time.  One or more 
  1079.             digits may be used; the value is always
  1080.             interpreted as a decimal number.  The hour must 
  1081.             be between 0 and 24, and the minutes (and
  1082.             seconds) - if present - between zero and 59. If 
  1083.             preceded by a "-", the time zone is east of the 
  1084.             Prime Meridian; otherwise it is west (which may
  1085.             be indicated by an optional preceding "+").
  1086.  
  1087.      start and end    Indicates when to change to and back from summer
  1088.                  time. Start describes the date when the change
  1089.             from standard to summer time occurs and end 
  1090.             describes the date when the change back
  1091.             happens.  The format of start and end must be
  1092.             one of the following:
  1093.  
  1094.             Jn    The Julian day n (1 < n < 365). Leap
  1095.                 days are not counted.  That is, in all
  1096.                 years, including leap years, February
  1097.                 28 is day 59 and March 1 is day 60.  It
  1098.                 is impossible to explicitly refer to
  1099.                 the occasional February 29.
  1100.  
  1101.             n    The zero-based Julian day (0 < n <
  1102.                 365).  Leap days are counted, and it is    
  1103.                 possible to refer to February 29.
  1104.  
  1105.             Mm.n.d    The nth d day of month m (1 < n < 5, 
  1106.                 0 < d < 6, 1 < m < 12).  When n is 5 it 
  1107.                 refers to the last d day of month m.
  1108.                 Day 0 is Sunday.
  1109.  
  1110.                  time    The time field describes the time when,
  1111.                 in current time, the change to or from
  1112.                 summer time occurs. Time has the same
  1113.                 format as offset except that no leading
  1114.                 sign (a minus (-) or a plus (+) sign)
  1115.                 is allowed. The default, if time is not
  1116.                 given, is 02:00:00.
  1117.  
  1118.     As an example of the previous format, if the TZ environment
  1119.     variable had the value EST5EDT4,M4.1.0,M10.5.0 it would    describe 
  1120.     the rule, which went into effect in 1987, for the Eastern time
  1121.     zone in the USA.  Specifically, EST would be the designation for
  1122.     standard time, which is 5 hours behind GMT.  EDT would be the 
  1123.     designation for DST, which is 4 hours behind GMT.  DST starts
  1124.     on the first Sunday in April and ends on the last Sunday in
  1125.     October.  In both cases, since the time was not specified, the
  1126.     change to and from DST would occur at the default time of 2:00 AM.
  1127.  
  1128.     The timezone call remains for compatibility reasons only; it is 
  1129.     impossible to reliably map timezone's arguments (zone, a
  1130.     `minutes west of GMT' value and DST, a `daylight saving time in
  1131.     effect' flag) to a time zone abbreviation.
  1132.  
  1133.  
  1134. 3.5.1    How do you change the timezone on NetBSD (FreeBSD also?)?
  1135.  
  1136.     Relink /etc/localtime.  This will correct the difference from
  1137.     GMT (or its trendy equivelant) to your local timezone.  In
  1138.     addition, the kernel needs to be modified to take the clock
  1139.     time in your CMOS into account.  Since most folks that run DOS
  1140.     prefer to have their clocks set to local time, the timezone
  1141.     hack was introduced to allow the kernel to adjust the CMOS
  1142.     clock time to GMT.  Once GMT has been computed, the
  1143.     /etc/localtime file can be referenced to determine the
  1144.     corrected local time.
  1145.  
  1146.     All generic kernels are built using the offset from California
  1147.     (why is anyone's guess:-) so just about everyone's clock will
  1148.     be off by their timezone offset from Berkeley.
  1149.  
  1150.  
  1151. 3.5.2    The translation between seconds-since-the-epoch and date
  1152.     differs by about 18 seconds between BSD and other Unixes when
  1153.     running ntp; why?
  1154.  
  1155.     See ntp FAQ. Apparently, the time correction takes leap seconds
  1156.     into account twice.  The timezone files in our system take the 
  1157.     leap seconds into account in the kernel, and nntp takes the
  1158.     same 18 leap seconds into account when syncing the time.
  1159.     Because of that, the time will appear to be off by eighteen
  1160.     seconds.  (Henning Schulzrinne)
  1161. -- 
  1162. TSgt Dave Burgess           | Dave Burgess
  1163. NCOIC, USSTRATCOM/J6844     | *BSD FAQ Maintainer
  1164. Offutt AFB, NE              | Burgess@cynjut.infonet.net or ...@s069.infonet...
  1165.                                
  1166.  
  1167.